SDK Types Reference
The xpander.ai SDK uses various data types, enumerations, and models across its modules. This reference provides comprehensive documentation for all shared types.Enumerations
AgentExecutionStatus
Enumeration of task execution statuses used throughout the Tasks and Agents modules.
Pending: Task is queued and waiting to startExecuting: Task is currently being executedPaused: Task execution is temporarily pausedError: Task encountered an error during executionFailed: Task execution failed to complete successfullyCompleted: Task finished successfullyStopped: Task was manually stopped
AgentDeploymentType
Enumeration of supported deployment types for agents.
Serverless: Agent runs in a serverless environment, ideal for lightweight tasksContainer: Agent runs in a containerized environment, suitable for resource-intensive operations
OutputFormat
Enumeration of supported output formats for task results.
Text: Plain text outputJson: JSON-formatted outputMarkdown: Markdown-formatted outputHtml: HTML-formatted output
TaskUpdateEventType
Enumeration of task event types for real-time streaming.
TaskCreated: Task was createdTaskUpdated: Task status or data was updatedTaskFinished: Task execution completedToolCallRequest: Agent is requesting to use a toolToolCallResult: Tool execution result is availableSubAgentTrigger: A sub-agent is triggered during execution
Data Models
AgentExecutionInput
Input configuration for task execution.
text(Optional[str]): The main prompt or instruction textfiles(Optional[List[str]]): URLs of files to process with the taskuser(Optional[User]): User details associated with task execution
text or files must be provided (validated automatically).
TaskUpdateEvent
Real-time event data from task execution.
type(TaskUpdateEventType): The type of eventtask_id(str): Unique identifier of the associated taskorganization_id(str): Organization identifiertime(datetime): Timestamp when the event occurreddata(Union[Task, ToolCallRequest, ToolCallResult]): Event-specific data payload
AgentActivityThread
Complete activity log for a task execution containing all messages, tool calls, reasoning, and events.
id(str): Unique identifier for the activity threadcreated_at(datetime): When the activity thread was createdmessages(List[AgentActivityThreadMessageType]): Ordered list of all activity messages (messages, tool calls, reasoning steps, etc.)user(Optional[User]): User associated with the activity, if available
AgentActivityThreadMessage: User/agent conversation messagesAgentActivityThreadToolCall: Tool invocations and resultsAgentActivityThreadReasoning: Agent reasoning stepsAgentActivityThreadSubAgentTrigger: Sub-agent invocationsAgentActivityThreadAuth: Authentication events
AgentActivityThreadMessage
User or agent conversation message in the activity log.
id(str): Message unique identifiercreated_at(datetime): When the message was createdrole(Literal[“user”, “agent”]): Whether message is from user or agentcontent(AgentActivityThreadMessageContent): Message content with text and files
AgentActivityThreadToolCall
Tool invocation record in the activity log.
id(str): Tool call unique identifiercreated_at(datetime): When the tool was calledtool_name(str): Name of the invoked toolpayload(Any): Input parameters sent to the toolis_error(bool): Whether the tool call resulted in an errorreasoning(Optional[ToolCallRequestReasoning]): Agent’s reasoning for using this toolresult(Optional[Any]): Tool execution result
AgentActivityThreadReasoning
Agent reasoning step in the activity log.
id(str): Reasoning step unique identifiercreated_at(datetime): When the reasoning occurredtype(AgentActivityThreadReasoningType): Type of reasoning (think/analyze)title(str): Brief title for the reasoning stepconfidence(float): Agent’s confidence level (0.0 to 1.0)thought(Optional[str]): Agent’s internal thought processaction(Optional[str]): Planned action based on reasoningresult(Optional[str]): Result of the reasoning stepanalysis(Optional[str]): Detailed analysis
AgentActivityThreadSubAgentTrigger
Sub-agent invocation record in the activity log.
id(str): Sub-agent trigger unique identifiercreated_at(datetime): When the sub-agent was triggeredagent_id(str): ID of the sub-agent being invokedquery(Optional[str]): Query sent to the sub-agentfiles(Optional[List[str]]): File URLs passed to the sub-agentreasoning(ToolCallRequestReasoning): Reasoning for triggering the sub-agent
ToolCallRequest
Tool invocation request event data.
request_id(str): Unique identifier for this specific requestoperation_id(str): Unique identifier for the operationtool_call_id(Optional[str]): Tool call identifiergraph_node_id(Optional[str]): Graph node identifiertool_name(Optional[str]): Name of the tool being requestedpayload(Optional[Any]): Input parameters for the tool
ToolCallResult
Tool invocation result event data.
request_id(str): Unique identifier for the original requestoperation_id(str): Unique identifier for the operationtool_call_id(Optional[str]): Tool call identifiergraph_node_id(Optional[str]): Graph node identifiertool_name(Optional[str]): Name of the tool that was executedpayload(Optional[Any]): Original payload from the requestresult(Optional[Any]): Result data from the tool executionis_error(Optional[bool]): Whether the tool execution resulted in an error
ToolInvocationResult
Result of invoking a tool, containing details about the execution outcome.
result(Any): The actual result data from the tool executionis_success(bool): Whether the tool execution was successfulerror(Optional[str]): Error message if execution failedexecution_time(float): Time taken for execution in seconds
KnowledgeBaseDocumentItem
Represents a document within a knowledge base.
id(str): Unique identifier for the documentdocument_url(str): URL where the document was originally locatedadded_at(datetime): Timestamp when the document was added
KnowledgeBaseSearchResult
Represents a search result from a knowledge base.
content(str): The matching content from the knowledge basescore(float): Relevance score for the search result (0.0 to 1.0)
AgnoSettings
Configuration settings for the Agno framework, including memory management and tool optimization.
session_storage(bool): Enable session-level storage for conversation context. Default:Trueagent_memories(bool): Enable agent-specific memory storage. Default:Falseuser_memories(bool): Enable user-specific memory across sessions. Default:Falseagentic_memory(bool): Enable advanced agentic memory capabilities. Default:Falseagentic_culture(bool): Enable cultural context for agents. Default:Falsesession_summaries(bool): Generate summaries of sessions. Default:Falsenum_history_runs(int): Number of historical runs to retain. Default:3max_tool_calls_from_history(int): Max tool calls to load from history. Default:0
tool_call_limit(int): Maximum tool calls per run. Default:None(unlimited)coordinate_mode(bool): Load agent as a Team for coordination. Default:Falsereasoning_tools_enabled(bool): Enable Agno reasoning tools. Default:Falsetool_calls_compression(AgnoToolCallsCompressionSettings): Tool call compression settings
pii_detection_enabled(bool): Enable PII detection on agent input. Default:Falsepii_detection_mask(bool): Mask detected PII instead of blocking. Default:Trueprompt_injection_detection_enabled(bool): Enable prompt injection detection. Default:Falseopenai_moderation_enabled(bool): Enable OpenAI content moderation. Default:Falseopenai_moderation_categories(List[str]): Specific moderation categories to enforce
AgnoToolCallsCompressionSettings
Settings for compressing tool call history to optimize context usage.
enabled(bool): Enable tool calls compression. Default:Falsethreshold(int): Number of tool calls before compression activates. Default:3instructions(str): Custom instructions for compression behavior. Default:""
Model Providers
Supported AI model providers in the xpander.ai platform: Supported Providers:- OpenAI - GPT models (gpt-4, gpt-4o, etc.)
- Environment:
OPENAI_API_KEYorAGENTS_OPENAI_API_KEY
- Environment:
- Anthropic - Claude models
- Environment:
ANTHROPIC_API_KEY
- Environment:
- Google AI Studio - Gemini models
- Environment:
GOOGLE_API_KEY
- Environment:
- NVIDIA NIM - NVIDIA inference microservices
- Environment:
NVIDIA_API_KEY
- Environment:
- Amazon Bedrock - AWS Bedrock models
- Environment:
AWS_BEARER_TOKEN_BEDROCK
- Environment:
- Fireworks - Fireworks AI models
- Environment:
FIREWORKS_API_KEY
- Environment:
- Helicone - OpenAI-compatible with monitoring
- Environment:
HELICONE_API_KEY
- Environment:
- Nebius - Nebius AI models
- Environment:
NEBIUS_API_KEY
- Environment:
- OpenRouter - Multi-model router
- Environment:
OPENROUTER_API_KEY
- Environment:
Common Patterns
Type Checking
Status Comparisons
Output Format Selection
Import Patterns
Individual Types
All Types
Specific Module Types
Related Documentation
- [Agents Module](/API reference/agents): Using types with agent operations
- [Tasks Module](/API reference/tasks): Task execution and status types
- [Tools Repository](/API reference/tools): Tool invocation result types
- [Knowledge Bases](/API reference/knowledge): Document and search result types
- [Events Module](/API reference/events): Event streaming types
- [SDK Exceptions](/API reference/exceptions): Error handling types

